1. Field of the Invention
The present invention relates to a decoding circuit which decompresses lossless-encoded compressed data.
2. Description of the Related Art
In decompressing lossless-encoded data, a decoding circuit decomposes the compressed data into commands and then performs a decoding operation by referring to data (decompressed data) stored in a line memory.
FIG. 1 is a block diagram showing an example of a decoding circuit.
An input buffer 201 temporarily stores compressed data input from the outside of the decoding circuit. The input buffer 201 has a memory size larger than the maximum code length defined for the compressed data so as to smoothly execute the process of the succeeding stage of the decoding circuit.
A command comparator 202 connected to the input buffer 201 has a command table 203. The command table 203 is formed from, e.g., a read-only memory (ROM) to record information (to be referred to as a command pattern hereinafter) necessary for decompressing compressed data, such as the type, attribute, and length of each command.
The command comparator 202 reads out a command pattern from the command table 203 and compares it with the compressed data received from the input buffer 201. The command comparator 202 notifies the input buffer 201 of the command length as the length of actually decoded data and transmits the command type and attribute of the comparison result to a decoder 204.
The input buffer 201 destructs data corresponding to the data length received from the command comparator 202 as decoded data and requests new external data as needed.
The decoder 204 has a line memory 205. The line memory 205 is formed from a random access memory (RAM) and serves as a temporary storage circuit for which data write or read is executed in decompressing compressed data. The decoder 204 is connected to an output buffer 206 which temporarily stores the decompressed data.
The decoder 204 determines based on the command type and attribute whether the decoding is that of raw data or a command that requires read access to the line memory 205. In decoding raw data, the decoder 204 transmits a raw component separated from the command to the output buffer 206. At this time, the raw component is written in the line memory 205 as a decoding result.
In decoding a command (decompressing compressed data) which requires read access to the line memory 205, the decoder 204 reads out data necessary for decompression of the compressed data from the line memory 205, executes a predetermined process, and transmits the decompressed data to the output buffer 206. At this time, the decompressed data is written in the line memory 205, as in decoding of raw data.
In decoding a command (decompressing compressed data) which requires read access to the line memory 205, access to the line memory 205 occurs after the command is passed through the command comparator 202 and input to the decoder 204. At this time, access to the line memory 205 is executed not continuously but discretely. A static RAM (SRAM) can cope with such access, and the line memory 205 normally uses an SRAM. However, the SRAM is more expensive than a RAM of another scheme such as a synchronous dynamic RAM (SDRAM).